package com.lanou3g.test;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;


/**
 * Created by dllo on 18/4/23.
 */
public class Sever {
    public static void main(String[] args) {
        try {
            ServerSocket ss = new ServerSocket(1234);
            System.out.println("服务器已启动,等待连接");

            while (true) {
                Socket client = ss.accept();

                System.out.println("有一个服务器接入"
                        + client.getRemoteSocketAddress());// 显示端口号

             new EchoThread(client).start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
